{include file="public/header" /}
<style type="text/css">.gray-bg {
    background: #fff;
}

.layui-form-checkbox i {

    height: 30px;

}

.wrapper {
    padding: 0px;
}</style>
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <form class="form-horizontal" method="post">
            <div class="col-sm-12">
                <div class="ibox-content">


                    <div class="form-group">
                        <label class="col-sm-2 control-label">操作</label>
                        <div class="col-sm-9">
                            <div class="radio i-checks choose-state">
                                {if $data.state eq 0}
                                <label><input type="radio" {if $data.state neq 0}disabled="disabled"{/if} name="state" value="1" {if $data.state eq 0 or $data.state eq 1}checked="checked" {/if} /> 通过</label>
                                <label><input type="radio" {if $data.state neq 0}disabled="disabled"{/if} name="state" value="2" {if $data.state eq 2}checked="checked" {/if} />拒绝 </label>
                                {else}
                                    {$states[$data['state']]}
                                {/if}

                            </div>
                        </div>
                    </div>

                    <div class="form-group" id="state_1" {if $data.state eq 2}style="display: none;"{/if}>
                        <label class="col-sm-2 control-label">邀请码：</label>
                        <div class="col-sm-9">
                            <input class="form-control" type="text" id="set_invite_code" {if $data.state neq 0}disabled="disabled"{/if} name="set_invite_code"
                                   value="{$data.set_invite_code|default=''}"/>
                        </div>
                    </div>

                    <div class="form-group" id="state_2" {if $data.state eq 0 or $data.state eq 1}style="display: none;"{/if}>
                        <label class="col-sm-2 control-label">原因：</label>
                        <div class="col-sm-9">
                            <input class="form-control" type="text" {if $data.state neq 0}disabled="disabled"{/if} id="reason" name="reason"
                                   value="{$data.reason|default='请填写用户真实资料'}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 control-label">推送{$data.state}</label>
                        <div class="col-sm-9 layui-form">
                            <input type="checkbox" {if $data.state neq 0}disabled="disabled"{/if} name="app_send" {if $data['app_send'] or $data.state eq 0}checked="checked"{/if}
                            title="app推送" value="1" />
                            <input type="checkbox" {if $data.state neq 0}disabled="disabled"{/if} name="sms_send" {if $data['sms_send'] or $data.state eq 0}checked="checked"{/if}
                            title="短信推送" value="1" />
                        </div>


                    </div>


                </div>
            </div>
            <input type="hidden" name="id" value="{$data.id|default=0}"/>
        </form>
    </div>
</div>
{include file="public/footer" /}
<script type="text/javascript" src="__STYLE__/admin/js/area.js?ver=20200522"></script>
{load href="__STYLE__/admin/plugins/iCheck/icheck.min.js"}
{load href="__STYLE__/admin/plugins/iCheck/custom.css"}
<script type="text/javascript">
    $(document).ready(function () {
        $(".i-checks").iCheck({
            checkboxClass: "icheckbox_square-green",
            radioClass: "iradio_square-green",
        });
    });
    layui.use('form', function () {
        var form = layui.form;
    });

    $(".choose-state").on('ifClicked', function (e) {
        var state = e.target.value;
        state == 2 ? $('#state_1').hide() : $('#state_2').hide();
        $('#state_' + state).show();
    });

    $("#upload").click(function () {
        layer.open({
            type: 2,
            title: '上传图片',
            shadeClose: true,
            shade: 0.2,
            area: ['70%', '60%'],
            skin: 'shangchuantup',
            content: "{:url('common/upload', ['type' => 'avatar'])}",
            shift: -1,
            scrollbar: false,
            moveType: 1,
            moveOut: true
        });
    });
</script>
{include file="public/bottom" /}